const express = require('express')
//解决跨域问题
const cors = require("cors")
const xiaomiRouter = require('./router/xiaomi')
 
const app = express()
const port = 3000


app.use(cors())
//正确解析post请求中的数据 
app.use(express.json())


app.use(xiaomiRouter)

app.listen(port, () => {
    console.log(`服务器已开启在${port}端口`);
})